"""
URL configuration for modem project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/5.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from app.views import upload_mapping, index, import_mapping, upload_settlement, readme, import_settlement, upload_management, import_management, download_template, export_mapping, export_settlement, settlement_list, edit_settlement, category_list, create_category, user_login, user_logout
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    path('admin/', admin.site.urls),
    # path('', include('app.urls')),
    path('index/', index, name='index'),
    path('loadmapping/', upload_mapping, name='loadmapping'),
    path('import_mapping/', import_mapping, name='import_mapping'),
    path('loadsettlement/', upload_settlement, name='loadsettlement'),
    path('import_settlement/', import_settlement, name='import_settlement'),
    path('loadmanagement/', upload_management, name='loadmanagement'),
    path('import_management/', import_management, name='import_management'),

    path('help/', readme, name='readme'),
    path('download_template/<str:filename>/', download_template, name='download_template'),
    path('export-mapping/', export_mapping, name='export_mapping'),
    path('export-settlement/', export_settlement, name='export_settlement'),
    path('settlement-list/', settlement_list, name='settlement_list'),
    path('edit-settlement/<int:pk>/', edit_settlement, name='edit_settlement'),
    path('category-list/', category_list, name='category_list'),
    path('create-category/', create_category, name='create_category'),
    path('login/', user_login, name='login'),
    path('logout/', user_logout, name='logout'),
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)